<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <title>录音</title>
        <style type="text/css">
            .aaa {
                margin-top: 100px;
            }
        </style>
    </head>
    <body>
        <div class="aaa"></div>
        <button onclick="begin()">录制</button>
        <button onclick="recStop()">停止</button>
        <button onclick="recPlay()">播放</button>
        <button onclick="recChange()">转换mp3</button>
    </body>
</html>
<script type="text/javascript" src="https://cdn.bootcss.com/vConsole/3.3.2/vconsole.min.js"></script>
<script>
    new VConsole()
</script>

<script src="./recorder.js"></script>
<script src="./lame.min.js"></script>
<script src="./soundRecording.js"></script>
<script type="text/javascript">
    // sampleBits: 采样位数，支持 8 或 16，默认是16
    // sampleRate: 采样率，支持11025、16000、22050、24000、44100、48000，根据浏览器默认值，我的chrome是48000
    // numChannels: 声道数, 1-单，2-双
    console.log(soundRecording)
    async function begin() {
       await soundRecording.initAction() 
       soundRecording.recStart()
    }
    
    function recStop() {
        soundRecording.recStop()
      

    }
    function recPlay() {
         soundRecording.recPlay()
    }

    function recChange() {
      
    }
</script>